home *** CD-ROM | disk | FTP | other *** search
Emacs Compiled Lisp | 1995-08-29 | 4.8 KB |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: Emacs Compiled Lisp
(other/emacsCompiledLisp).
This format is not currently supported by dexvert.
Confidence | Program | Detection | Match Type | Support
|
---|
1%
| dexvert
| Emacs Compiled Lisp (other/emacsCompiledLisp)
| magic
| Unsupported |
1%
| dexvert
| Combustion 2 Particle Library (other/combustion2ParticleLibrary)
| ext
| Unsupported |
100%
| file
| Emacs/XEmacs v19 byte-compiled Lisp data
| default
| |
99%
| file
| data
| default
| |
100%
| TrID
| Emacs/XEmacs byte-compiled Lisp (generic)
| default
| |
100%
| xdgMime
| text/x-emacs-lisp
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 3b 45 4c 43 13 00 00 00 | 0a 3b 3b 3b 20 63 6f 6d |;ELC....|.;;; com|
|00000010| 70 69 6c 65 64 20 62 79 | 20 63 74 68 6f 6d 70 40 |piled by| cthomp@|
|00000020| 77 69 6c 6c 6f 77 2e 63 | 73 2e 75 69 75 63 2e 65 |willow.c|s.uiuc.e|
|00000030| 64 75 20 6f 6e 20 54 75 | 65 20 41 75 67 20 32 39 |du on Tu|e Aug 29|
|00000040| 20 31 34 3a 35 32 3a 35 | 34 20 31 39 39 35 0a 3b | 14:52:5|4 1995.;|
|00000050| 3b 3b 20 66 72 6f 6d 20 | 66 69 6c 65 20 2f 65 78 |;; from |file /ex|
|00000060| 70 6f 72 74 2f 77 69 6c | 6c 6f 77 33 2f 78 65 6d |port/wil|low3/xem|
|00000070| 61 63 73 2d 31 39 2e 31 | 33 2d 72 65 6c 65 61 73 |acs-19.1|3-releas|
|00000080| 65 2f 65 64 69 74 6f 72 | 2f 6c 69 73 70 2f 68 79 |e/editor|/lisp/hy|
|00000090| 70 65 72 62 6f 6c 65 2f | 73 65 74 2e 65 6c 0a 3b |perbole/|set.el.;|
|000000a0| 3b 3b 20 65 6d 61 63 73 | 20 76 65 72 73 69 6f 6e |;; emacs| version|
|000000b0| 20 31 39 2e 31 33 20 58 | 45 6d 61 63 73 20 4c 75 | 19.13 X|Emacs Lu|
|000000c0| 63 69 64 2e 0a 3b 3b 3b | 20 62 79 74 65 63 6f 6d |cid..;;;| bytecom|
|000000d0| 70 20 76 65 72 73 69 6f | 6e 20 32 2e 32 35 3b 20 |p versio|n 2.25; |
|000000e0| 31 2d 53 65 70 2d 39 34 | 2e 0a 3b 3b 3b 20 6f 70 |1-Sep-94|..;;; op|
|000000f0| 74 69 6d 69 7a 61 74 69 | 6f 6e 20 69 73 20 6f 6e |timizati|on is on|
|00000100| 2e 0a 3b 3b 3b 20 74 68 | 69 73 20 66 69 6c 65 20 |..;;; th|is file |
|00000110| 75 73 65 73 20 6f 70 63 | 6f 64 65 73 20 77 68 69 |uses opc|odes whi|
|00000120| 63 68 20 64 6f 20 6e 6f | 74 20 65 78 69 73 74 20 |ch do no|t exist |
|00000130| 69 6e 20 45 6d 61 63 73 | 20 31 38 2e 0a 0a 28 69 |in Emacs| 18...(i|
|00000140| 66 20 28 61 6e 64 20 28 | 62 6f 75 6e 64 70 20 27 |f (and (|boundp '|
|00000150| 65 6d 61 63 73 2d 76 65 | 72 73 69 6f 6e 29 0a 09 |emacs-ve|rsion)..|
|00000160| 20 28 6f 72 20 28 61 6e | 64 20 28 62 6f 75 6e 64 | (or (an|d (bound|
|00000170| 70 20 27 65 70 6f 63 68 | 3a 3a 76 65 72 73 69 6f |p 'epoch|::versio|
|00000180| 6e 29 20 65 70 6f 63 68 | 3a 3a 76 65 72 73 69 6f |n) epoch|::versio|
|00000190| 6e 29 0a 09 20 20 20 20 | 20 28 73 74 72 69 6e 67 |n).. | (string|
|000001a0| 2d 6c 65 73 73 70 20 65 | 6d 61 63 73 2d 76 65 72 |-lessp e|macs-ver|
|000001b0| 73 69 6f 6e 20 22 31 39 | 22 29 29 29 0a 20 20 20 |sion "19|"))). |
|000001c0| 20 28 65 72 72 6f 72 20 | 22 54 68 69 73 20 66 69 | (error |"This fi|
|000001d0| 6c 65 20 77 61 73 20 63 | 6f 6d 70 69 6c 65 64 20 |le was c|ompiled |
|000001e0| 66 6f 72 20 45 6d 61 63 | 73 20 31 39 2e 22 29 29 |for Emac|s 19."))|
|000001f0| 0a 0a 28 64 65 66 76 61 | 72 20 73 65 74 3a 65 71 |..(defva|r set:eq|
|00000200| 75 61 6c 2d 6f 70 20 27 | 65 71 75 61 6c 20 22 5c |ual-op '|equal "\|
|00000210| 0a 43 6f 6d 70 61 72 69 | 73 6f 6e 20 66 75 6e 63 |.Compari|son func|
|00000220| 74 69 6f 6e 20 75 73 65 | 64 20 62 79 20 73 65 74 |tion use|d by set|
|00000230| 20 6f 70 65 72 61 74 6f | 72 73 2e 0a 49 74 20 6d | operato|rs..It m|
|00000240| 75 73 74 20 62 65 20 61 | 20 66 75 6e 63 74 69 6f |ust be a| functio|
|00000250| 6e 20 6f 66 20 74 77 6f | 20 61 72 67 75 6d 65 6e |n of two| argumen|
|00000260| 74 73 20 77 68 69 63 68 | 20 72 65 74 75 72 6e 73 |ts which| returns|
|00000270| 20 6e 6f 6e 2d 6e 69 6c | 20 6f 6e 6c 79 20 77 68 | non-nil| only wh|
|00000280| 65 6e 0a 74 68 65 20 61 | 72 67 75 6d 65 6e 74 73 |en.the a|rguments|
|00000290| 20 61 72 65 20 65 71 75 | 69 76 61 6c 65 6e 74 2e | are equ|ivalent.|
|000002a0| 22 29 0a 28 66 73 65 74 | 20 27 73 65 74 3a 61 64 |").(fset| 'set:ad|
|000002b0| 64 20 27 28 6d 61 63 72 | 6f 20 2e 20 23 5b 28 65 |d '(macr|o . #[(e|
|000002c0| 6c 74 20 73 65 74 29 20 | 22 c0 c1 5c 6e 0b 45 0b |lt set) |"..\n.E.|
|000002d0| 44 0b c4 0b c5 5c 6e 0b | 45 45 44 c6 c7 5c 6e 44 |D....\n.|EED..\nD|
|000002e0| 44 46 87 22 20 5b 63 6f | 6e 64 20 73 65 74 3a 6d |DF." [co|nd set:m|
|000002f0| 65 6d 62 65 72 20 65 6c | 74 20 73 65 74 20 73 65 |ember el|t set se|
|00000300| 74 71 20 63 6f 6e 73 20 | 74 20 6c 69 73 74 5d 20 |tq cons |t list] |
|00000310| 38 20 22 5c 0a 41 64 64 | 73 20 65 6c 65 6d 65 6e |8 "\.Add|s elemen|
|00000320| 74 20 45 4c 54 20 74 6f | 20 53 45 54 20 61 6e 64 |t ELT to| SET and|
|00000330| 20 74 68 65 6e 20 72 65 | 74 75 72 6e 73 20 53 45 | then re|turns SE|
|00000340| 54 2e 0a 55 73 65 73 20 | 27 73 65 74 3a 65 71 75 |T..Uses |'set:equ|
|00000350| 61 6c 2d 6f 70 27 20 66 | 6f 72 20 63 6f 6d 70 61 |al-op' f|or compa|
|00000360| 72 69 73 6f 6e 2e 0a 55 | 73 65 20 28 73 65 74 71 |rison..U|se (setq|
|00000370| 20 73 65 74 20 28 73 65 | 74 3a 61 64 64 20 65 6c | set (se|t:add el|
|00000380| 74 20 73 65 74 29 29 20 | 74 6f 20 61 73 73 75 72 |t set)) |to assur|
|00000390| 65 20 73 65 74 20 69 73 | 20 61 6c 77 61 79 73 20 |e set is| always |
|000003a0| 70 72 6f 70 65 72 6c 79 | 20 6d 6f 64 69 66 69 65 |properly| modifie|
|000003b0| 64 2e 22 5d 29 29 0a 28 | 66 73 65 74 20 27 73 65 |d."])).(|fset 'se|
|000003c0| 74 3a 63 6f 6d 62 69 6e | 61 74 69 6f 6e 73 20 23 |t:combin|ations #|
|000003d0| 5b 28 73 65 74 20 26 6f | 70 74 69 6f 6e 61 6c 20 |[(set &o|ptional |
|000003e0| 61 72 69 74 79 29 20 22 | 08 ac 8d c1 10 c2 c3 c4 |arity) "|........|
|000003f0| c5 c6 0e 07 5c 22 5c 22 | 42 87 08 c8 55 ab 83 0e |....\"\"|B...U...|
|00000400| 07 87 08 c1 58 ab 82 c9 | 87 c2 c8 1e 5c 6e 1e 0b |....X...|....\n..|
|00000410| c3 c4 c5 cc 0e 07 5c 22 | 5c 22 2a 87 22 20 5b 61 |......\"|\"*." [a|
|00000420| 72 69 74 79 20 30 20 6e | 69 6c 20 61 70 70 6c 79 |rity 0 n|il apply|
|00000430| 20 6e 63 6f 6e 63 20 6d | 61 70 63 61 72 20 23 5b | nconc m|apcar #[|
|00000440| 28 65 6c 74 29 20 22 08 | 54 10 c1 5c 6e 08 5c 22 |(elt) ".|T..\n.\"|
|00000450| 87 22 20 5b 61 72 69 74 | 79 20 73 65 74 3a 63 6f |." [arit|y set:co|
|00000460| 6d 62 69 6e 61 74 69 6f | 6e 73 20 73 65 74 5d 20 |mbinatio|ns set] |
|00000470| 33 5d 20 73 65 74 20 31 | 20 28 6e 69 6c 29 20 63 |3] set 1| (nil) c|
|00000480| 74 72 20 72 65 73 74 20 | 23 5b 28 66 69 72 73 74 |tr rest |#[(first|
|00000490| 29 20 22 08 09 9b 12 08 | 54 10 c3 c4 c5 5c 6e 0e |) ".....|T....\n.|
|000004a0| 06 53 5c 22 5c 22 87 22 | 20 5b 63 74 72 20 73 65 |.S\"\"."| [ctr se|
|000004b0| 74 20 72 65 73 74 20 6d | 61 70 63 61 72 20 23 5b |t rest m|apcar #[|
|000004c0| 28 65 6c 74 29 20 22 08 | 3c ab 84 09 08 42 87 09 |(elt) ".|<....B..|
|000004d0| 08 44 87 22 20 5b 65 6c | 74 20 66 69 72 73 74 5d |.D." [el|t first]|
|000004e0| 20 32 5d 20 73 65 74 3a | 63 6f 6d 62 69 6e 61 74 | 2] set:|combinat|
|000004f0| 69 6f 6e 73 20 61 72 69 | 74 79 5d 20 35 5d 5d 20 |ions ari|ty] 5]] |
|00000500| 36 20 22 5c 0a 52 65 74 | 75 72 6e 73 20 61 6c 6c |6 "\.Ret|urns all|
|00000510| 20 70 6f 73 73 69 62 6c | 65 20 63 6f 6d 62 69 6e | possibl|e combin|
|00000520| 61 74 69 6f 6e 73 20 28 | 73 75 62 73 65 74 73 29 |ations (|subsets)|
|00000530| 20 6f 66 20 53 45 54 2e | 0a 41 73 73 75 6d 65 73 | of SET.|.Assumes|
|00000540| 20 53 45 54 20 69 73 20 | 61 20 76 61 6c 69 64 20 | SET is |a valid |
|00000550| 73 65 74 2e 20 20 57 69 | 74 68 20 6f 70 74 69 6f |set. Wi|th optio|
|00000560| 6e 61 6c 20 41 52 49 54 | 59 2c 20 72 65 74 75 72 |nal ARIT|Y, retur|
|00000570| 6e 73 20 6f 6e 6c 79 20 | 73 75 62 73 65 74 73 20 |ns only |subsets |
|00000580| 77 69 74 68 0a 41 52 49 | 54 59 20 6d 65 6d 62 65 |with.ARI|TY membe|
|00000590| 72 73 2e 22 5d 29 0a 28 | 66 73 65 74 20 27 73 65 |rs."]).(|fset 'se|
|000005a0| 74 3a 63 72 65 61 74 65 | 20 23 5b 28 26 72 65 73 |t:create| #[(&res|
|000005b0| 74 20 65 6c 65 6d 65 6e | 74 73 29 20 22 c0 19 c2 |t elemen|ts) "...|
|000005c0| c3 0c 40 ab 85 0c 40 3c | ac 83 0c aa 82 0c 40 5c |..@...@<|......@\|
|000005d0| 22 88 09 29 87 22 20 5b | 6e 69 6c 20 73 65 74 20 |"..)." [|nil set |
|000005e0| 6d 61 70 63 61 72 20 23 | 5b 28 65 6c 74 29 20 22 |mapcar #|[(elt) "|
|000005f0| c0 09 5c 6e 5c 22 ae 85 | 09 5c 6e 42 89 12 87 22 |..\n\"..|.\nB..."|
|00000600| 20 5b 73 65 74 3a 6d 65 | 6d 62 65 72 20 65 6c 74 | [set:me|mber elt|
|00000610| 20 73 65 74 5d 20 33 5d | 20 65 6c 65 6d 65 6e 74 | set] 3]| element|
|00000620| 73 5d 20 33 20 22 5c 0a | 52 65 74 75 72 6e 73 20 |s] 3 "\.|Returns |
|00000630| 61 20 6e 65 77 20 73 65 | 74 20 63 72 65 61 74 65 |a new se|t create|
|00000640| 64 20 66 72 6f 6d 20 61 | 6e 79 20 6e 75 6d 62 65 |d from a|ny numbe|
|00000650| 72 20 6f 66 20 45 4c 45 | 4d 45 4e 54 53 20 6f 72 |r of ELE|MENTS or|
|00000660| 20 61 20 6c 69 73 74 20 | 6f 66 20 45 4c 45 4d 45 | a list |of ELEME|
|00000670| 4e 54 53 2e 0a 55 73 65 | 73 20 27 73 65 74 3a 65 |NTS..Use|s 'set:e|
|00000680| 71 75 61 6c 2d 6f 70 27 | 20 66 6f 72 20 63 6f 6d |qual-op'| for com|
|00000690| 70 61 72 69 73 6f 6e 2e | 22 5d 29 0a 28 66 73 65 |parison.|"]).(fse|
|000006a0| 74 20 27 73 65 74 3a 64 | 65 6c 65 74 65 20 27 73 |t 'set:d|elete 's|
|000006b0| 65 74 3a 72 65 6d 6f 76 | 65 29 0a 28 66 73 65 74 |et:remov|e).(fset|
|000006c0| 20 27 73 65 74 3a 64 69 | 66 66 65 72 65 6e 63 65 | 'set:di|fference|
|000006d0| 20 23 5b 28 26 72 65 73 | 74 20 73 65 74 73 29 20 | #[(&res|t sets) |
|000006e0| 22 c0 09 40 21 1a c3 c4 | 09 41 5c 22 88 5c 6e 29 |"..@!...|.A\".\n)|
|000006f0| 87 22 20 5b 73 65 74 3a | 6d 65 6d 62 65 72 73 20 |." [set:|members |
|00000700| 73 65 74 73 20 72 74 6e | 2d 73 65 74 20 6d 61 70 |sets rtn|-set map|
|00000710| 63 61 72 20 23 5b 28 73 | 65 74 29 20 22 c0 c1 5c |car #[(s|et) "..\|
|00000720| 6e 5c 22 87 22 20 5b 6d | 61 70 63 61 72 20 23 5b |n\"." [m|apcar #[|
|00000730| 28 65 6c 74 29 20 22 c0 | 09 5c 6e 5c 22 5c 6e 1b |(elt) ".|.\n\"\n.|
|00000740| 89 1c ab a7 0b 47 c5 55 | ab 84 c6 13 aa 9d 0c 47 |.....G.U|.......G|
|00000750| c5 55 ab 8b 0b 47 c7 5a | 0b 9b c6 a1 88 aa 8c 0c |.U...G.Z|........|
|00000760| 89 41 40 a0 88 0c 89 41 | 41 a1 88 0b 2a 87 22 20 |.A@....A|A...*." |
|00000770| 5b 73 65 74 3a 6d 65 6d | 62 65 72 20 65 6c 74 20 |[set:mem|ber elt |
|00000780| 72 74 6e 2d 73 65 74 20 | 72 74 6e 20 72 65 73 74 |rtn-set |rtn rest|
|00000790| 20 31 20 6e 69 6c 20 32 | 5d 20 34 5d 20 73 65 74 | 1 nil 2|] 4] set|
|000007a0| 5d 20 33 5d 5d 20 33 20 | 22 5c 0a 52 65 74 75 72 |] 3]] 3 |"\.Retur|
|000007b0| 6e 73 20 64 69 66 66 65 | 72 65 6e 63 65 20 6f 66 |ns diffe|rence of|
|000007c0| 20 61 6e 79 20 6e 75 6d | 62 65 72 20 6f 66 20 53 | any num|ber of S|
|000007d0| 45 54 53 2e 0a 44 69 66 | 66 65 72 65 6e 63 65 20 |ETS..Dif|ference |
|000007e0| 69 73 20 74 68 65 20 73 | 65 74 20 6f 66 20 65 6c |is the s|et of el|
|000007f0| 65 6d 65 6e 74 73 20 69 | 6e 20 74 68 65 20 66 69 |ements i|n the fi|
|00000800| 72 73 74 20 73 65 74 20 | 74 68 61 74 20 61 72 65 |rst set |that are|
|00000810| 20 6e 6f 74 20 69 6e 20 | 61 6e 79 20 6f 66 20 74 | not in |any of t|
|00000820| 68 65 0a 6f 74 68 65 72 | 20 73 65 74 73 2e 20 20 |he.other| sets. |
|00000830| 55 73 65 73 20 27 73 65 | 74 3a 65 71 75 61 6c 2d |Uses 'se|t:equal-|
|00000840| 6f 70 27 20 66 6f 72 20 | 63 6f 6d 70 61 72 69 73 |op' for |comparis|
|00000850| 6f 6e 2e 22 5d 29 0a 28 | 66 73 65 74 20 27 73 65 |on."]).(|fset 'se|
|00000860| 74 3a 65 71 75 61 6c 20 | 23 5b 28 73 65 74 31 20 |t:equal |#[(set1 |
|00000870| 73 65 74 32 29 20 22 08 | 3c ad 91 09 3c ad 8d c2 |set2) ".|<...<...|
|00000880| 08 21 c2 09 21 55 ad 84 | c3 08 09 5c 22 87 22 20 |.!..!U..|...\"." |
|00000890| 5b 73 65 74 31 20 73 65 | 74 32 20 73 65 74 3a 73 |[set1 se|t2 set:s|
|000008a0| 69 7a 65 20 73 65 74 3a | 73 75 62 73 65 74 5d 20 |ize set:|subset] |
|000008b0| 33 20 22 5c 0a 52 65 74 | 75 72 6e 73 20 74 20 69 |3 "\.Ret|urns t i|
|000008c0| 66 66 20 53 45 54 31 20 | 63 6f 6e 74 61 69 6e 73 |ff SET1 |contains|
|000008d0| 20 74 68 65 20 73 61 6d | 65 20 6d 65 6d 62 65 72 | the sam|e member|
|000008e0| 73 20 61 73 20 53 45 54 | 32 2e 20 20 42 6f 74 68 |s as SET|2. Both|
|000008f0| 20 6d 75 73 74 20 62 65 | 20 73 65 74 73 2e 0a 55 | must be| sets..U|
|00000900| 73 65 73 20 27 73 65 74 | 3a 65 71 75 61 6c 2d 6f |ses 'set|:equal-o|
|00000910| 70 27 20 66 6f 72 20 63 | 6f 6d 70 61 72 69 73 6f |p' for c|ompariso|
|00000920| 6e 2e 22 5d 29 0a 28 66 | 73 65 74 20 27 73 65 74 |n."]).(f|set 'set|
|00000930| 3a 67 65 74 20 23 5b 28 | 6b 65 79 20 73 65 74 29 |:get #[(|key set)|
|00000940| 20 22 c0 19 c2 0b 0c 5c | 22 29 40 41 87 22 20 5b | ".....\|")@A." [|
|00000950| 23 5b 28 6b 65 79 20 65 | 6c 74 29 20 22 08 09 40 |#[(key e|lt) "..@|
|00000960| 9a 87 22 20 5b 6b 65 79 | 20 65 6c 74 5d 20 32 5d |.." [key| elt] 2]|
|00000970| 20 73 65 74 3a 65 71 75 | 61 6c 2d 6f 70 20 73 65 | set:equ|al-op se|
|00000980| 74 3a 6d 65 6d 62 65 72 | 20 6b 65 79 20 73 65 74 |t:member| key set|
|00000990| 5d 20 33 20 22 5c 0a 52 | 65 74 75 72 6e 73 20 74 |] 3 "\.R|eturns t|
|000009a0| 68 65 20 76 61 6c 75 65 | 20 61 73 73 6f 63 69 61 |he value| associa|
|000009b0| 74 65 64 20 77 69 74 68 | 20 4b 45 59 20 69 6e 20 |ted with| KEY in |
|000009c0| 53 45 54 20 6f 72 20 6e | 69 6c 2e 0a 45 6c 65 6d |SET or n|il..Elem|
|000009d0| 65 6e 74 73 20 6f 66 20 | 53 45 54 20 73 68 6f 75 |ents of |SET shou|
|000009e0| 6c 64 20 62 65 20 6f 66 | 20 74 68 65 20 66 6f 72 |ld be of| the for|
|000009f0| 6d 20 28 6b 65 79 20 2e | 20 76 61 6c 75 65 29 2e |m (key .| value).|
|00000a00| 22 5d 29 0a 28 66 73 65 | 74 20 27 73 65 74 3a 69 |"]).(fse|t 'set:i|
|00000a10| 6e 74 65 72 73 65 63 74 | 69 6f 6e 20 23 5b 28 26 |ntersect|ion #[(&|
|00000a20| 72 65 73 74 20 73 65 74 | 73 29 20 22 c0 19 c2 c3 |rest set|s) "....|
|00000a30| 0c 40 5c 22 88 09 29 87 | 22 20 5b 6e 69 6c 20 72 |.@\"..).|" [nil r|
|00000a40| 74 6e 2d 73 65 74 20 6d | 61 70 63 61 72 20 23 5b |tn-set m|apcar #[|
|00000a50| 28 65 6c 74 29 20 22 c0 | c1 c2 0b 41 5c 22 3e ae |(elt) ".|...A\">.|
|00000a60| 85 0c 0d 42 89 15 87 22 | 20 5b 6e 69 6c 20 6d 61 |...B..."| [nil ma|
|00000a70| 70 63 61 72 20 23 5b 28 | 73 65 74 29 20 22 c0 09 |pcar #[(|set) "..|
|00000a80| 5c 6e 5c 22 87 22 20 5b | 73 65 74 3a 6d 65 6d 62 |\n\"." [|set:memb|
|00000a90| 65 72 20 65 6c 74 20 73 | 65 74 5d 20 33 5d 20 73 |er elt s|et] 3] s|
|00000aa0| 65 74 73 20 65 6c 74 20 | 72 74 6e 2d 73 65 74 5d |ets elt |rtn-set]|
|00000ab0| 20 34 5d 20 73 65 74 73 | 5d 20 33 20 22 5c 0a 52 | 4] sets|] 3 "\.R|
|00000ac0| 65 74 75 72 6e 73 20 69 | 6e 74 65 72 73 65 63 74 |eturns i|ntersect|
|00000ad0| 69 6f 6e 20 6f 66 20 61 | 6c 6c 20 53 45 54 53 20 |ion of a|ll SETS |
|00000ae0| 67 69 76 65 6e 20 61 73 | 20 61 72 67 75 6d 65 6e |given as| argumen|
|00000af0| 74 73 2e 0a 55 73 65 73 | 20 27 73 65 74 3a 65 71 |ts..Uses| 'set:eq|
|00000b00| 75 61 6c 2d 6f 70 27 20 | 66 6f 72 20 63 6f 6d 70 |ual-op' |for comp|
|00000b10| 61 72 69 73 6f 6e 2e 22 | 5d 29 0a 28 66 73 65 74 |arison."|]).(fset|
|00000b20| 20 27 73 65 74 3a 69 73 | 20 23 5b 28 6f 62 6a 29 | 'set:is| #[(obj)|
|00000b30| 20 22 08 3c ad 93 08 19 | c2 09 40 09 41 5c 22 ac | ".<....|..@.A\".|
|00000b40| 86 09 41 89 11 ac 72 09 | 29 3f 87 22 20 5b 6f 62 |..A...r.|)?." [ob|
|00000b50| 6a 20 6c 73 74 20 73 65 | 74 3a 6d 65 6d 62 65 72 |j lst se|t:member|
|00000b60| 5d 20 33 20 22 5c 0a 52 | 65 74 75 72 6e 73 20 74 |] 3 "\.R|eturns t|
|00000b70| 20 69 66 20 4f 42 4a 20 | 69 73 20 61 20 73 65 74 | if OBJ |is a set|
|00000b80| 20 28 61 20 6c 69 73 74 | 20 77 69 74 68 20 6e 6f | (a list| with no|
|00000b90| 20 72 65 70 65 61 74 65 | 64 20 65 6c 65 6d 65 6e | repeate|d elemen|
|00000ba0| 74 73 29 2e 0a 55 73 65 | 73 20 27 73 65 74 3a 65 |ts)..Use|s 'set:e|
|00000bb0| 71 75 61 6c 2d 6f 70 27 | 20 66 6f 72 20 63 6f 6d |qual-op'| for com|
|00000bc0| 70 61 72 69 73 6f 6e 2e | 22 5d 29 0a 28 66 73 65 |parison.|"]).(fse|
|00000bd0| 74 20 27 73 65 74 3a 6d | 61 70 20 27 6d 61 70 63 |t 'set:m|ap 'mapc|
|00000be0| 61 72 29 0a 28 66 73 65 | 74 20 27 73 65 74 3a 6d |ar).(fse|t 'set:m|
|00000bf0| 65 6d 62 65 72 20 23 5b | 28 65 6c 74 20 73 65 74 |ember #[|(elt set|
|00000c00| 29 20 22 08 ab 8d 09 5c | 6e 08 40 5c 22 ac 86 08 |) "....\|n.@\"...|
|00000c10| 41 89 10 ac 73 08 87 22 | 20 5b 73 65 74 20 73 65 |A...s.."| [set se|
|00000c20| 74 3a 65 71 75 61 6c 2d | 6f 70 20 65 6c 74 5d 20 |t:equal-|op elt] |
|00000c30| 34 20 22 5c 0a 52 65 74 | 75 72 6e 73 20 6e 6f 6e |4 "\.Ret|urns non|
|00000c40| 2d 6e 69 6c 20 69 66 20 | 45 4c 54 20 69 73 20 61 |-nil if |ELT is a|
|00000c50| 6e 20 65 6c 65 6d 65 6e | 74 20 6f 66 20 53 45 54 |n elemen|t of SET|
|00000c60| 2e 0a 54 68 65 20 76 61 | 6c 75 65 20 69 73 20 61 |..The va|lue is a|
|00000c70| 63 74 75 61 6c 6c 79 20 | 74 68 65 20 74 61 69 6c |ctually |the tail|
|00000c80| 20 6f 66 20 53 45 54 20 | 77 68 6f 73 65 20 63 61 | of SET |whose ca|
|00000c90| 72 20 69 73 20 45 4c 54 | 2e 0a 55 73 65 73 20 27 |r is ELT|..Uses '|
|00000ca0| 73 65 74 3a 65 71 75 61 | 6c 2d 6f 70 27 20 66 6f |set:equa|l-op' fo|
|00000cb0| 72 20 63 6f 6d 70 61 72 | 69 73 6f 6e 2e 22 5d 29 |r compar|ison."])|
|00000cc0| 0a 28 66 73 65 74 20 27 | 73 65 74 3a 6d 65 6d 62 |.(fset '|set:memb|
|00000cd0| 65 72 73 20 23 5b 28 6c | 69 73 74 29 20 22 c0 19 |ers #[(l|ist) "..|
|00000ce0| c2 c3 0c 5c 22 88 09 29 | 87 22 20 5b 6e 69 6c 20 |...\"..)|." [nil |
|00000cf0| 73 65 74 20 6d 61 70 63 | 61 72 20 23 5b 28 65 6c |set mapc|ar #[(el|
|00000d00| 74 29 20 22 c0 09 5c 6e | 5c 22 ae 85 09 5c 6e 42 |t) "..\n|\"...\nB|
|00000d10| 89 12 87 22 20 5b 73 65 | 74 3a 6d 65 6d 62 65 72 |..." [se|t:member|
|00000d20| 20 65 6c 74 20 73 65 74 | 5d 20 33 5d 20 6c 69 73 | elt set|] 3] lis|
|00000d30| 74 5d 20 33 20 22 5c 0a | 52 65 74 75 72 6e 73 20 |t] 3 "\.|Returns |
|00000d40| 73 65 74 20 6f 66 20 75 | 6e 69 71 75 65 20 65 6c |set of u|nique el|
|00000d50| 65 6d 65 6e 74 73 20 6f | 66 20 4c 49 53 54 2e 0a |ements o|f LIST..|
|00000d60| 55 73 65 73 20 27 73 65 | 74 3a 65 71 75 61 6c 2d |Uses 'se|t:equal-|
|00000d70| 6f 70 27 20 66 6f 72 20 | 63 6f 6d 70 61 72 69 73 |op' for |comparis|
|00000d80| 6f 6e 2e 20 20 53 65 65 | 20 61 6c 73 6f 20 27 73 |on. See| also 's|
|00000d90| 65 74 3a 63 72 65 61 74 | 65 27 2e 22 5d 29 0a 28 |et:creat|e'."]).(|
|00000da0| 66 73 65 74 20 27 73 65 | 74 3a 72 65 6d 6f 76 65 |fset 'se|t:remove|
|00000db0| 20 27 28 6d 61 63 72 6f | 20 2e 20 23 5b 28 65 6c | '(macro| . #[(el|
|00000dc0| 74 20 73 65 74 29 20 22 | c0 c1 c2 0b 0c 45 44 c5 |t set) "|.....ED.|
|00000dd0| 0c 44 44 c6 42 42 87 22 | 20 5b 6c 65 74 20 72 65 |.DD.BB."| [let re|
|00000de0| 73 74 20 73 65 74 3a 6d | 65 6d 62 65 72 20 65 6c |st set:m|ember el|
|00000df0| 74 20 73 65 74 20 72 74 | 6e 20 28 28 69 66 20 72 |t set rt|n ((if r|
|00000e00| 65 73 74 20 28 63 6f 6e | 64 20 28 28 3d 20 28 6c |est (con|d ((= (l|
|00000e10| 65 6e 67 74 68 20 72 74 | 6e 29 20 31 29 20 28 73 |ength rt|n) 1) (s|
|00000e20| 65 74 71 20 72 74 6e 20 | 6e 69 6c 29 29 20 28 28 |etq rtn |nil)) ((|
|00000e30| 3d 20 28 6c 65 6e 67 74 | 68 20 72 65 73 74 29 20 |= (lengt|h rest) |
|00000e40| 31 29 20 28 73 65 74 63 | 64 72 20 28 6e 74 68 63 |1) (setc|dr (nthc|
|00000e50| 64 72 20 28 2d 20 28 6c | 65 6e 67 74 68 20 72 74 |dr (- (l|ength rt|
|00000e60| 6e 29 20 32 29 20 72 74 | 6e 29 20 6e 69 6c 29 29 |n) 2) rt|n) nil))|
|00000e70| 20 28 74 20 28 73 65 74 | 63 61 72 20 72 65 73 74 | (t (set|car rest|
|00000e80| 20 28 63 61 72 20 28 63 | 64 72 20 72 65 73 74 29 | (car (c|dr rest)|
|00000e90| 29 29 20 28 73 65 74 63 | 64 72 20 72 65 73 74 20 |)) (setc|dr rest |
|00000ea0| 28 63 64 72 20 28 63 64 | 72 20 72 65 73 74 29 29 |(cdr (cd|r rest))|
|00000eb0| 29 29 29 29 20 72 74 6e | 29 5d 20 35 20 22 5c 0a |)))) rtn|)] 5 "\.|
|00000ec0| 52 65 6d 6f 76 65 73 20 | 65 6c 65 6d 65 6e 74 20 |Removes |element |
|00000ed0| 45 4c 54 20 66 72 6f 6d | 20 53 45 54 20 61 6e 64 |ELT from| SET and|
|00000ee0| 20 72 65 74 75 72 6e 73 | 20 6e 65 77 20 73 65 74 | returns| new set|
|00000ef0| 2e 0a 41 73 73 75 6d 65 | 73 20 53 45 54 20 69 73 |..Assume|s SET is|
|00000f00| 20 61 20 76 61 6c 69 64 | 20 73 65 74 2e 20 20 55 | a valid| set. U|
|00000f10| 73 65 73 20 27 73 65 74 | 3a 65 71 75 61 6c 2d 6f |ses 'set|:equal-o|
|00000f20| 70 27 20 66 6f 72 20 63 | 6f 6d 70 61 72 69 73 6f |p' for c|ompariso|
|00000f30| 6e 2e 0a 55 73 65 20 28 | 73 65 74 71 20 73 65 74 |n..Use (|setq set|
|00000f40| 20 28 73 65 74 3a 72 65 | 6d 6f 76 65 20 65 6c 74 | (set:re|move elt|
|00000f50| 20 73 65 74 29 29 20 74 | 6f 20 61 73 73 75 72 65 | set)) t|o assure|
|00000f60| 20 73 65 74 20 69 73 20 | 61 6c 77 61 79 73 20 70 | set is |always p|
|00000f70| 72 6f 70 65 72 6c 79 20 | 6d 6f 64 69 66 69 65 64 |roperly |modified|
|00000f80| 2e 22 5d 29 29 0a 28 66 | 73 65 74 20 27 73 65 74 |."])).(f|set 'set|
|00000f90| 3a 72 65 70 6c 61 63 65 | 20 23 5b 28 6b 65 79 20 |:replace| #[(key |
|00000fa0| 76 61 6c 75 65 20 73 65 | 74 29 20 22 c0 09 5c 6e |value se|t) "..\n|
|00000fb0| 5c 22 89 1b ab 89 0b 09 | 0c 42 a0 88 5c 6e aa 85 |\"......|.B..\n..|
|00000fc0| 09 0c 42 5c 6e 42 29 87 | 22 20 5b 73 65 74 3a 6d |..B\nB).|" [set:m|
|00000fd0| 65 6d 62 65 72 20 6b 65 | 79 20 73 65 74 20 65 6c |ember ke|y set el|
|00000fe0| 74 2d 73 65 74 20 76 61 | 6c 75 65 5d 20 34 20 22 |t-set va|lue] 4 "|
|00000ff0| 5c 0a 52 65 70 6c 61 63 | 65 73 20 6f 72 20 61 64 |\.Replac|es or ad|
|00001000| 64 73 20 65 6c 65 6d 65 | 6e 74 20 77 68 6f 73 65 |ds eleme|nt whose|
|00001010| 20 63 61 72 20 6d 61 74 | 63 68 65 73 20 4b 45 59 | car mat|ches KEY|
|00001020| 20 77 69 74 68 20 65 6c | 65 6d 65 6e 74 20 28 4b | with el|ement (K|
|00001030| 45 59 20 2e 20 56 41 4c | 55 45 29 20 69 6e 20 53 |EY . VAL|UE) in S|
|00001040| 45 54 2e 0a 52 65 74 75 | 72 6e 73 20 73 65 74 20 |ET..Retu|rns set |
|00001050| 69 66 20 6d 6f 64 69 66 | 69 65 64 2c 20 65 6c 73 |if modif|ied, els|
|00001060| 65 20 6e 69 6c 2e 0a 55 | 73 65 20 28 73 65 74 71 |e nil..U|se (setq|
|00001070| 20 73 65 74 20 28 73 65 | 74 3a 72 65 70 6c 61 63 | set (se|t:replac|
|00001080| 65 20 65 6c 74 20 73 65 | 74 29 29 20 74 6f 20 61 |e elt se|t)) to a|
|00001090| 73 73 75 72 65 20 73 65 | 74 20 69 73 20 61 6c 77 |ssure se|t is alw|
|000010a0| 61 79 73 20 70 72 6f 70 | 65 72 6c 79 20 6d 6f 64 |ays prop|erly mod|
|000010b0| 69 66 69 65 64 2e 0a 0a | 55 73 65 73 20 27 73 65 |ified...|Uses 'se|
|000010c0| 74 3a 65 71 75 61 6c 2d | 6f 70 27 20 74 6f 20 6d |t:equal-|op' to m|
|000010d0| 61 74 63 68 20 61 67 61 | 69 6e 73 74 20 4b 45 59 |atch aga|inst KEY|
|000010e0| 2e 20 20 41 73 73 75 6d | 65 73 20 65 61 63 68 20 |. Assum|es each |
|000010f0| 65 6c 65 6d 65 6e 74 20 | 69 6e 20 74 68 65 20 73 |element |in the s|
|00001100| 65 74 0a 68 61 73 20 61 | 20 63 61 72 20 61 6e 64 |et.has a| car and|
|00001110| 20 61 20 63 64 72 2e 22 | 5d 29 0a 28 66 73 65 74 | a cdr."|]).(fset|
|00001120| 20 27 73 65 74 3a 73 69 | 7a 65 20 27 6c 65 6e 67 | 'set:si|ze 'leng|
|00001130| 74 68 29 0a 28 66 73 65 | 74 20 27 73 65 74 3a 73 |th).(fse|t 'set:s|
|00001140| 75 62 73 65 74 20 23 5b | 28 73 75 62 20 73 65 74 |ubset #[|(sub set|
|00001150| 29 20 22 c0 19 c2 c3 0c | 5c 22 88 09 ad 81 c0 29 |) ".....|\".....)|
|00001160| 87 22 20 5b 74 20 69 73 | 20 6d 61 70 63 61 72 20 |." [t is| mapcar |
|00001170| 23 5b 28 65 6c 74 29 20 | 22 08 ad 86 c1 5c 6e 0b |#[(elt) |"....\n.|
|00001180| 5c 22 89 10 87 22 20 5b | 69 73 20 73 65 74 3a 6d |\"..." [|is set:m|
|00001190| 65 6d 62 65 72 20 65 6c | 74 20 73 65 74 5d 20 33 |ember el|t set] 3|
|000011a0| 5d 20 73 75 62 5d 20 33 | 20 22 5c 0a 52 65 74 75 |] sub] 3| "\.Retu|
|000011b0| 72 6e 73 20 74 20 69 66 | 66 20 73 65 74 20 53 55 |rns t if|f set SU|
|000011c0| 42 20 69 73 20 61 20 73 | 75 62 73 65 74 20 6f 66 |B is a s|ubset of|
|000011d0| 20 53 45 54 2e 0a 55 73 | 65 73 20 27 73 65 74 3a | SET..Us|es 'set:|
|000011e0| 65 71 75 61 6c 2d 6f 70 | 27 20 66 6f 72 20 63 6f |equal-op|' for co|
|000011f0| 6d 70 61 72 69 73 6f 6e | 2e 22 5d 29 0a 28 66 73 |mparison|."]).(fs|
|00001200| 65 74 20 27 73 65 74 3a | 75 6e 69 6f 6e 20 23 5b |et 'set:|union #[|
|00001210| 28 26 72 65 73 74 20 73 | 65 74 73 29 20 22 c0 19 |(&rest s|ets) "..|
|00001220| c2 c3 0c 5c 22 88 09 29 | 87 22 20 5b 6e 69 6c 20 |...\"..)|." [nil |
|00001230| 72 74 6e 2d 73 65 74 20 | 6d 61 70 63 61 72 20 23 |rtn-set |mapcar #|
|00001240| 5b 28 73 65 74 29 20 22 | c0 c1 5c 6e 5c 22 87 22 |[(set) "|..\n\"."|
|00001250| 20 5b 6d 61 70 63 61 72 | 20 23 5b 28 65 6c 74 29 | [mapcar| #[(elt)|
|00001260| 20 22 c0 09 5c 6e 5c 22 | ab 83 5c 6e aa 8c 5c 6e | "..\n\"|..\n..\n|
|00001270| ab 87 09 5c 6e 42 89 12 | aa 82 09 43 89 12 87 22 |...\nB..|...C..."|
|00001280| 20 5b 73 65 74 3a 6d 65 | 6d 62 65 72 20 65 6c 74 | [set:me|mber elt|
|00001290| 20 72 74 6e 2d 73 65 74 | 5d 20 33 5d 20 73 65 74 | rtn-set|] 3] set|
|000012a0| 5d 20 33 5d 20 73 65 74 | 73 5d 20 33 20 22 5c 0a |] 3] set|s] 3 "\.|
|000012b0| 52 65 74 75 72 6e 73 20 | 75 6e 69 6f 6e 20 6f 66 |Returns |union of|
|000012c0| 20 61 6c 6c 20 53 45 54 | 53 20 67 69 76 65 6e 20 | all SET|S given |
|000012d0| 61 73 20 61 72 67 75 6d | 65 6e 74 73 2e 0a 55 73 |as argum|ents..Us|
|000012e0| 65 73 20 27 73 65 74 3a | 65 71 75 61 6c 2d 6f 70 |es 'set:|equal-op|
|000012f0| 27 20 66 6f 72 20 63 6f | 6d 70 61 72 69 73 6f 6e |' for co|mparison|
|00001300| 2e 22 5d 29 0a 28 70 72 | 6f 76 69 64 65 20 27 73 |."]).(pr|ovide 's|
|00001310| 65 74 29 0a | |et). | |
+--------+-------------------------+-------------------------+--------+--------+